package cn.edu.nit.sys.controller;

import cn.edu.nit.sys.service.ReportService;
import cn.edu.nit.sys.utils.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author 罗文斌
 * @Date 2023/4/16
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    @PostMapping
    public R addReport(@RequestBody Map<String, String> params) {
        return reportService.addReport(params);
    }

    @GetMapping
    public R reportList(Page<Map<String, String>> page, String siftName) {
        return reportService.getList(page, siftName);
    }

    @PostMapping("/ban")
    public R addBan(@RequestBody Map<String, String> params) {
        return reportService.addBan(params);
    }
}
